package mmc.action.skill;

import java.util.Collection;

import mmc.Client;
import mmc.Player;
import mmc.cell.ClientCell;
import mmc.server.RemoteClient;

public class DebugCommand extends Skill{
	public DebugCommand(){
		super("Debug", "mmc/resource/data/Smoke.png", 3600);
	}

	@Override
	public void performOnClient() {
		Player player = Client.client.getScene().player;
		//Client.client.getScene().addObject(mmc.objects.ParticleTest.class, player.x,player.y,player.z);
		//Client.client.getScene().addObject(mmc.objects.Orb.class, player.x,player.y,player.z);
		//Client.client.getScene().addObject(mmc.objects.GenericColladaObject.class, player.x,player.y,player.z);
		
		int invisible=0;
		int loadsRequested = 0;
		
		Collection<ClientCell> cells = Client.client.getScene().getCellBunch().getCells().values();
		
		for(ClientCell c : cells){
			if(c.isVisibilityImpossible())
				invisible++;
			loadsRequested += c.countPendingLoads();
		}
		
		player.whisper("Invisible Cells: "+invisible+" of "+cells.size(),player.getName());
		player.whisper(String.format("Cells array integrity: %.2f %% ("+loadsRequested+" loads pending)",100-1e2f*loadsRequested/(float)(cells.size()*6)),player.getName());
	}

	@Override
	public void endCast(RemoteClient client) {
		// TODO Auto-generated method stub
		
	}
}
